﻿#include "game.h"


void meun() //菜单
{
	printf("*****************\n");
	printf("*****1.play******\n");
	printf("*****0.exit******\n");

}

void game()
{
	char show[ROWS][COLS];
	char mine[ROWS][COLS];
	//初始化棋盘
	Bord_init(show, ROWS, COLS, '*');
	Bord_init(mine, ROWS, COLS, '0');
	//设置地雷
	Set_mine(mine, ROW, COL);
	//排查地雷
	Find_mine(mine, show, ROW, COL);
}

int main()
{
	srand((unsigned int)time(NULL));
	int input = 0;
	do {
		meun();
		printf("请输入:");
		scanf("%d", &input);
		switch (input)
		{
		case 1:
			printf("开始游戏!\n");
			Sleep(1000);
			system("cls");
			game();
			break;
		case 0:
			printf("Bye!\n");
			Sleep(1000);
			break;
		default:
			printf("输入错误\n");
			Sleep(1000);
			break;
		}
		system("cls");

	} while (input);
	return 0;
}
